import static org.junit.Assert.*;

import org.junit.Test;


public class CalendarApplicationTest {
	CalendarApplication tester;

	@Test
	public void testIsValidDate() {
		tester = new CalendarApplication();
		assertTrue("Date incorrectly validated", tester.isValidDate("01/01/2015"));
		assertTrue("Date incorrectly validated", tester.isValidDate("06/24/2015"));
		assertFalse("Date incorrectly validated", tester.isValidDate("Fail"));
		assertFalse("Date incorrectly validated", tester.isValidDate("1/1/2003"));
		assertFalse("Date incorrectly validated", tester.isValidDate("01/02/13"));
		assertFalse("Date incorrectly validated", tester.isValidDate("02/35/2013"));
	}

	@Test
	public void testIsValidHour() {
		tester = new CalendarApplication();
		assertTrue("Hour incorrectly validated", tester.isValidHour("01"));
		assertTrue("Hour incorrectly validated", tester.isValidHour("12"));
		assertFalse("Hour incorrectly validated", tester.isValidHour("Fail"));
		assertFalse("Hour incorrectly validated", tester.isValidHour("13"));
		assertFalse("Hour incorrectly validated", tester.isValidHour("1"));
	}

	@Test
	public void testIsValidMin() {
		tester = new CalendarApplication();
		assertTrue("Minute incorrectly validated", tester.isValidMin("01"));
		assertTrue("Minute incorrectly validated", tester.isValidMin("30"));
		assertFalse("Minute incorrectly validated", tester.isValidMin("Fail"));
		assertFalse("Minute incorrectly validated", tester.isValidMin("61"));
		assertFalse("Minute incorrectly validated", tester.isValidMin("1"));
	}

	@Test
	public void testIsValidOrder() {
		tester = new CalendarApplication();
		assertTrue("Order incorrectly validated", tester.isValidOrder("01/12/2015", "01/12/2015", "06", "06", "30", "45", "AM", "AM"));
		assertFalse("Order incorrectly validated", tester.isValidOrder("01/12/2015", "01/12/2015", "06", "06", "45", "30", "AM", "AM"));
	}

}
